<template>
	<view class="message">
		<!-- schoolDate -->
<<<<<<< HEAD

=======
        <!-- schoolDate -->
>>>>>>> e2fda11145908a856d1ef500e8cc56aafa1dbda3
		<view class="schoolDate">
			<view class="date">
				<text class="big" >{{restDay}}</text>
				<text class="tian">天</text>
				<text class="small" >{{timeItem.remind}}倒计时</text>
			</view>
			<view class="chooseSchool">
				<text>确认报考资格名称，备考更高效</text>
				<button type="primary" size="mini" @click="chooseSchool">选择></button>
			</view>
		</view>
		<!-- schoolDate end -->
		<!-- nav -->
		<view class="nav">
			<uni-link class="navItem" v-for="(item,index) in navItem" :key="index" :href="item.url" >
				<image :src="item.src" mode=""></image>
				<text>{{item.text}}</text>
			</uni-link>
		</view>
		<!-- nav end -->
		<!-- testScore -->
	    <view class="testScore">
			<view class="testHeader">
				<view :class="navIndex===1?'activite':''" @click="checkIndex(1)">
					报名流程
				</view>
				<view :class="navIndex===2?'activite':''" @click="checkIndex(2)">
					考试时间
				</view>
				<view :class="navIndex===3?'activite':''" @click="checkIndex(3)">
					成绩查询
				</view>
			</view>
			<view class="content" v-if="navIndex==1">
				<view class="content_item" v-for="(item,index) in navsContent1" :key="index">
					<view class="word">
						<text class="big">{{item.big}}</text>
						<text class="small">{{item.small}}</text>
					</view>
					<uni-link :href="item.url" class="btn">{{item.button}}</uni-link>
				</view>
			</view>
			<view class="content1" v-if="navIndex==2">
				<view class="date">
					<text>日期</text>
					<text>2023.05.27</text>
					<text>2023.05.27</text>
					<!-- <text>2023.05.27</text>
					<text>2023.05.27</text> -->
				</view>
				<view class="time">
					<text>时间</text>
					<text>09:00-11:30</text>
					<text>14:00-16:30</text>
			<!-- 		<text>08:30-11:30</text>
					<text>14:00-17:00</text> -->
				</view>
				<view class="subject">
					<text>科目</text>
					<text>基础知识/综合知识</text>
					<text>应用技术</text>
					<!-- <text>专业课一</text>
					<text>专业课二</text> -->
				</view>
			</view>
			<view class="content" v-if="navIndex==3">
				<view class="content_item" v-for="(item,index) in navsContent3" :key="index">
					<view class="word">
						<text class="big">{{item.big}}</text>
						<text class="small">{{item.small}}</text>
					</view>
					<uni-link :href="item.url" class="btn">{{item.button}}</uni-link>
				</view>
			</view>
	    </view>
		<!-- testScore end -->
		<!-- schoolMessage -->
	    <view class="schoolMessage">
			<view class="testHeader1">
				<view :class="navIndex1===1?'activite':''" @click="checkIndex1(1)">
					最新动态
				</view>
				<view :class="navIndex1===2?'activite':''" @click="checkIndex1(2)">
					考试详情
				</view>
				<view :class="navIndex1===3?'activite':''" @click="checkIndex1(3)">
					报刊公告
				</view>
			</view>
			<view class="content1" v-if="navIndex1==1">
				<view class="content1_item" v-for="(item,index) in content1_item" :key="index">
					<text class="big">{{item.big}}</text>
					<text class="small">{{item.small}}</text>
				</view>
			</view>
			<view class="content1" v-if="navIndex1==2">
				<view class="content1_item" v-for="(item,index) in content2_item" :key="index">
					<text class="big">{{item.big}}</text>
					<text class="small">{{item.small}}</text>
				</view>
			</view>
			<view class="content1" v-if="navIndex1==3">
				<view class="content1_item" v-for="(item,index) in content3_item" :key="index">
					<text class="big">{{item.big}}</text>
					<text class="small">{{item.small}}</text>
				</view>
			</view>
		</view>
		<!-- schoolMessage end -->
		<view  :class="mask?'showMask':'noMask'">
			<view class="timeEdit">
				<view class="time">
					<text class="editPlan">编辑计划的软考时间</text>
					<text class="induce">为你推荐更合适的内容</text>
					<view class="chooseTime">
						<view class="timeItem" 
						v-for="(item,index) in timeItem"
						:class="timeIndex===index?'activeTime':''"
						:key="index" 
						@click="timeSelect(index)">
							<text class="year">{{item.year}}</text>
							<text class="remind">{{item.remind}}</text>
						</view>
					</view>
				</view>

        <!-- 这是一个备注 -->
				<view class="school">
					<text class="editSchool">编辑目标报考资格名称</text>
					<view class="choose" @click="editSchool(url)">
						<text>添加资格名称</text>
						<text class="plus">+</text>
					</view>
				</view>
				<view class="select">
					<view class="btn"  @click="cancelMask()">
						取消
					</view>
					<view class="btn" :class="select?'activeSelect':''" @click="confirmSelect()">
						确定
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navIndex:1,
				navIndex1:1,
				mask:false,   // 遮罩。true 显示，false 隐藏
				select:false, 
				timeIndex:0,   // 选择的时间的索引
				timeItem:[
					
					{
						year:"2023年5月",
						remind:"2023年上半年软考",
						date:"2023-05-27",
						id:1
					},
					{
						year:"2023年11月",
						remind:"2023年下半年软考",
						date:"2023-11-04",
						id:2
					},
					{
						year:"其他",
						date:"2024-05-27",
						id:3
					}
				],
				restDay:0,  // 倒计时天数
				navItem:[
					{
						src:'../../static/icons/two.png',
						text:"考试计划",
						url:"https://www.ruankao.org.cn/"
					},
					{
						src:'../../static/icons/tongji.png',
						text:"报考指南",
						url:"https://www.ruankao.org.cn/"
					},
					{
						src:'../../static/icons/kaodiandagang.png',
						text:"考试大纲",
						url:"https://www.ruankao.org.cn/"
					},
					{
						src:'../../static/icons/huati.png',
						text:"热门话题",
						path:'/pages/index/hot/hot'
					}
				],
				navsContent1:[
					{
						big:"考试报名",
						small:"2023.03.17-2023.04.03",
						button:"报名缴费>",
						url:"https://www.ruankao.org.cn/platform"
					},
					{
						big:"准考证打印",
						small:"2023.05.22-2023.05.26",
						button:"打印入口>",
						url:"https://www.ruankao.org.cn/platform"
					},
					  {
					 	big:"参加考试",
					 	small:"2023.05.27-2023.05.28",
						button:"考试安排>",
					 	url:"https://www.ruankao.org.cn/platform"
					 },
					//  {
					// 	big:"查询成绩/领取证书",
					// 	small:"考试结束后的一个月（30个工作日）进行公布",
					// 	button:"查询入口>",
					// 	url:"https://www.ruankao.org.cn/platform"
					// },
				],
				navsContent3:[
					{
						big:"成绩",
						small:"2023.07.23起",
						button:"查分入口>",
						url:"https://www.ruankao.org.cn/"
						
					},
					{
						big:"成绩复核",
						small:"2023.07.25-2023.08.01",
						button:"复核入口>",
						url:"https://www.ruankao.org.cn/"
						
					},
					{
					 	big:"证书领取",
					 	small:"2023.10.08-2023.10.21",
					 	button:"领取入口>",
					 	url:"https://www.ruankao.org.cn/"
						
					 },
					// {
					// 	big:"复试及调剂",
					// 	small:"3月到4月底系统开放",
					// 	button:"调剂系统>",
					// 	url:"https://yz.chsi.com.cn/wap/yztj/"
						
					// }
				],
			    content1_item:[
					{
						big:"工业和信息化部教育与考试中心关于计算机软件专业技术资格考试等三项考试考务费标准的通知",
						small:"2023-02-07"
					},
					{
						big:"中华人民共和国人力资源和社会保障部令第31号《专业技术人员资格考试违纪违规行为处理规定》",
						small:"20223-01-16"
					},
					
				],
				content2_item:[
					{
						big:"2023年度计算机技术与软件专业技术资格（水平）考试工作计划",
						small:"2023-02-07"
					},
					{
						big:"2022年全国计算机技术与软件专业技术资格(水平)考试工作安排",
						small:"2023-02-07"
					},
					
				],
				content3_item:[
					{
						big:"关于计算机技术与软件专业技术资格(水平)考试新增专业有关问题的通知",
						small:"2023-02-01"
					},
					{
						big:"国家职业资格目录",
						small:"2023-01-07"
					}
				]
			}
		},
		onLoad() {
			 	this.showRestDay(this.timeItem[0].date);
		},
		methods: {
			showRestDay(tDay){
				let tagDay = new Date(tDay);
				let nowDay = new Date();
				let dis = Math.abs( nowDay - tagDay );
				let days = Math.floor(dis / (24*60*60*1000));
				this.restDay = days;
				console.info(tDay);
			},
			checkIndex(index){
				this.navIndex=index;
			},
			checkIndex1(index){
				this.navIndex1=index;
			},
			navItemClick(url){
				uni.navigateTo({
					url
				})
			},
			chooseSchool(){
				this.mask=!this.mask;
			},
			editSchool(){
				uni.navigateTo({
					url:'/pages/index/chooseShool/chooseShool'
				})
			},
			timeSelect(index){
				this.timeIndex = index ;
			},
			cancelMask(){
				this.mask=false
			},
			confirmSelect(){
				this.select=!this.select;
				this.showRestDay(this.timeItem[this.timeIndex].date);
				console.info( this.timeIndex);
				console.info(this.timeItem[this.timeIndex])
				this.cancelMask();  // 取消弹出框
			},
			webChange(e){
				window.location.href=e
			}
				
		}
	}
</script>

<style lang="scss">
.message{
	padding-left: 30rpx;
	padding-right: 30rpx;
	font-family: "微软雅黑";
	position: relative;
	.schoolDate{
		margin-top: 20rpx;
		height: 380rpx;
		border-radius: 40rpx;
		box-shadow: 0 8rpx 4rpx 0 #c0c0c0;
		overflow: hidden;
		.date{
			height: 130px;
			width: 100%;
			background: url(../../static/book/school1_03.jpg) 130px no-repeat;
			background-size: contain;
			padding-left: 40rpx;
			.big{
				display: inline-block;
				font-size: 40rpx;
				font-weight: bold;
				color:#3a45ef;
				margin-top: 100rpx;
				margin-bottom: 10rpx;
				margin-right: 10rpx;
			}
			.tian{
				font-size: 24rpx;
				font-weight: bold;
				
			}
			.small{
				display: block;
				font-size: 24rpx;
				color: #808080;
			}
		}
		.chooseSchool{
			background: #fbfbfb;
			display: flex;
			font-size: 28rpx;
			line-height: 120rpx;
			padding-left: 40rpx;
			border-bottom-left-radius: 40rpx;
			border-bottom-right-radius: 40rpx;
			button{
				height: 60rpx;
				margin-top: 30rpx;
			}
		}
	}
    .nav{
		display: flex;
		justify-content: space-between;
		margin-top: 60rpx;
		.navItem{
			height: 140rpx;
			width: 140rpx;
			text-decoration: none;
			image{
				height: 50rpx;
				width: 50rpx;
				margin-left: 40rpx;
			}
			text{
				display: block;
				font-size: 12px;
				text-align: center;
				
				color: #303133;
			}
		}
	}	
	.activite{
		border-bottom: 1px solid #757575;
	}
    .testScore{
		margin-top: 40rpx;
		height: 540rpx;
		width: 100%;
		border-radius: 40rpx;
		background: #f8f8f8;
		padding-top: 40rpx;
		.testHeader{
			margin-right: 40rpx;
			margin-left: 40rpx;
			padding-left: 20rpx;
			padding-right: 20rpx;
			display: flex;
			justify-content: space-between;
			height: 80rpx;
			line-height: 80rpx;
			border-radius: 20rpx;
			margin-bottom: 40rpx;
			font-weight: bold;
			font-size: 16px;
			color: #808080;
			
		}
		.content1{
			display: flex;
			justify-content: space-between;
			padding-left: 40rpx;
			padding-right: 40rpx;
			font-size: 14px;
			color: #808080;
			
			text{
				display: block;
				height: 84rpx;
			}
		}
		
		.content{
			padding-left: 40rpx;
			padding-right: 40rpx;
			.content_item{
				display: flex;
				height:100rpx;
				position: relative;
				.word{
					text{
						display: block;
						letter-spacing: 1px;
					}
					.big{
						font-size: 28rpx;
						font-weight: bold;
						margin-bottom: 10rpx;
						color: #353535;
					}
					.small{
						font-size: 20rpx;
						color: #808080;
					}
				}
				.btn{
					// background-color: #007afc;
					position: absolute;
					height: 60rpx;
					width: 160rpx;
					border: 1px solid #ccc;
					border-radius: 5px;
					text-align: center;
					line-height: 60rpx;
					text-decoration: none;
					right: 0;
					top: 20rpx;
					letter-spacing: 1px;
					
				}
			}
		}
	}
	.schoolMessage{
		.testHeader1{
			display: flex;
			height: 60rpx;
			justify-content: space-between;
			margin-top: 60rpx;
			margin-bottom: 40rpx;
			font-weight: bold;
			font-size: 16px;
			color: #808080;	
		}
		.content1{
			.content1_item{
				height: 140rpx;
				border-bottom: 1px solid #ccc;
				margin-bottom: 10rpx;
				text{
					display: block;
				}
				.big{
					font-size: 14px;
					margin-bottom: 20rpx;
					font-weight: bold;
					line-height: 40rpx;
					letter-spacing: 1px;
					color: #353535;
				}
				.small{
					font-size: 20rpx;
					color: #808080;
				}
			}
		}
	}
	
}
.noMask{
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.5);
	z-index: 999999;
}
.showMask{
	display: block;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.5);
	z-index: 999999;
	letter-spacing: 1px;
	.timeEdit{
		background: #fff;
		display: flex;
		flex-wrap: wrap;
		border-top-left-radius: 60rpx;
		border-top-right-radius: 60rpx;
		position: absolute;
		bottom:-60rpx;
		right: 0;
		left: 0;
		padding:40rpx;
		.time{
			width: 670rpx;
			margin-bottom: 40rpx;
			text{
				display: block;
			}
			.editPlan{
				font-size: 40rpx;
				font-weight: bold;
				margin-bottom: 10rpx;
			}
			.induce{
				font-size: 14px;
				color: #808080;	
				margin-bottom: 40rpx;
			}
			.chooseTime{
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				.timeItem{
					width: 270rpx;
					height: 65rpx;
					background: #eee;
					text-align: center;
					border-radius: 20rpx;
					margin-bottom: 20rpx;
					padding: 25rpx;
					&.activeTime{
						border: 1px solid #55aaff;
					}
					.year{
						font-size: 32rpx;
						color: #4e4eeb;
						font-weight: bold;
					}
					.remind{
						font-size: 12px;
						color: #b6b6b6;
					}
				}
			}
		}
		.school{
			margin-bottom: 30rpx;
			width: 670rpx;
			text{
				display: block;
			}
			.editSchool{
				font-size: 40rpx;
				font-weight: bold;
				margin-bottom: 20rpx;
			}
			.choose{
				line-height: 120rpx;
				border-radius: 20rpx;
				background: #eeeeee;
				display: flex;
				justify-content: space-between;
				padding-left: 40rpx;
				padding-right: 40rpx;
				.plus{
					font-size: 60rpx;
				}
			}
		}
		.select{
			display: flex;
			justify-content: space-between;
			width: 650rpx;
			text-align: center;
			margin-bottom: 60rpx;
			.btn{
				height: 90rpx;
				line-height: 90rpx;
				width: 300rpx;
				background: #eee;
				border-radius: 20rpx;
				font-weight: bold;
				letter-spacing: 4rpx;
			}
			.activeSelect{
				background: #55aaff;
				color:#fff;
			}
		}
	}
}


</style>
